#ifndef WRSERVICE_LOG_H
#define WRSERVICE_LOG_H

#include <windows.h>
#include <string>
//#include <plog/log.h>
//#include "LogEvents.h"

namespace wrservice
{

class Log
{
    //CRITICAL_SECTION    log_cs_;
    wchar_t             file_name_[MAX_PATH];
    
    static const DWORD  temp_buffer_size_ = 500;    // size of temporary buffers

    void define_log_file_ ();
    void error_description_ (
        __in  DWORD  dwErrorCode,
        __out LPWSTR lpErrorBuffer,
        __in  DWORD  dwBufferSize
        );

public:
    Log();
    ~Log();
    
    void write_error (LPSTR);
    void write_event (LPSTR);

    Log& operator<< (LPSTR msg)
        { this->write_error(msg); return *this; }
};

} /* namespace wrservice */

#endif /* WRSERVICE_LOG_H */
